class Solution {

    const int MOD = 1e9 + 7;

public:
    int valueAfterKSeconds(int n, int k) {

        vector<int> arr(n + 1, 1);
        arr[0] = 0;

        // k ++;
        while (k--)
        {
            for (int i = 1; i <= n; i++)
                arr[i] = (arr[i] + arr[i - 1]) % MOD;
        }

        return arr[n] % MOD;
    }
};